<?php

class Pageley_Reflection_Recording {
    private $key;
    private $returnValue;
    private $executor;
    
    public function __construct($key) {
        $this->key = $key;
    }
    
    public function andExecute($executor) {
        $this->executor = $executor;
        return $this;
    }
    
    public function andReturn($returnValue) {
        $this->returnValue = $returnValue;
        return $this;
    }
    
    public function executeAndReturn($parameters) {
        if($this->executor != null) {
            $this->executor->execute($parameters);
        }
        return $this->returnValue;
    }
    
    public function getKey() {
        return $this->key;
    }
}